home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / dos_win / winsock / hacklist / 94-05 / text0015.txt < prev    next >
Encoding:
Text File  |  1994-05-19  |  7.8 KB  |  168 lines

  1. Thus expounded Bob Quinn on May 4,11:50pm:
  2. /--------------------
  3. note: | xxx = Bob
  4.       |> xxx = me
  5.  
  6. [after an anlysis on why itis not possible to know whether a close
  7.  was gracefully successful or abortive ]
  8.  
  9. |I always thought that too, but after Bruce's persistence now I
  10. |realize that it's not defined this way (though it should be).
  11. |You get the FD_CLOSE when the socket goes into FIN_WAIT ...which
  12. |is just after you *send* the FIN, not when you recieve it (which
  13. |would be when it enters TIME_WAIT).  Stupid?  Yup.  There's no
  14. |sense asking to be told something you already know.
  15. |
  16. |>          One could argue that the paragraph under WSAAsyncSelect that begins
  17. |>  "The error code in an FD_CLOSE message indicates whether the socket
  18. |>  close was graceful or abortive" would mandate that FD_CLOSE is
  19. |>  NOT posted as soon as the application calls closesocket() or shutdown(),
  20. |>  because the DLL doesn't know yet whether the close will work properly,
  21. |>  and so can't tell yet what error code to post.
  22. |>          In fact, I beleive the semantics you want can be acheived if, in the
  23. |>  bit that says "...FD_CLOSE is posted when the connection goes into the
  24. |>  FIN_WAIT or CLOSE_WAIT states", the "FIN_WAIT" is interpreted as a typo,
  25. |>  and should have been "TIME_WAIT" :-)
  26. |
  27. |Exactamundo.
  28. |
  29. |This sounds like fodder for the ambiguities group (or whatever
  30. |it's called) for WinSock 2.  Boy, won't that be a fun group.
  31.  
  32. I wouldn't miss it for anything, although I don't think it will be any
  33. more enjoyable than a dentist visit. In this case, though, I don't feel
  34. that there will be too many problems.
  35.     In over an hour of coming up with various scenarios, I can't find
  36. one situation where an application written to the spec as it is interpreted
  37. now will be disadvantaged if the FD_CLOSE is not posted until just slightly
  38. later than some stacks are doing, based on the FIN_WAIT/CLOSE_WAIT
  39. paragraph, which has been taken too literally by most of us - probably
  40. because it mentioned concrete examples of when to do something, so we all
  41. thought it would be easier to beleive it than to think of what the correct
  42. behaviour might be based on a more vague paragraph. If the FD_CLOSE is not
  43. posted until the remote's FIN/ACK arrives, I don't feel that _any_ existing
  44. code will break, so the "FIN_WAIT" can be altered to read "TIME_WAIT" in
  45. everybodies copies of Winsock 1.1 without any drama at all.
  46.  
  47.     If _anybody_ can think of a code sequence that won't work correctly
  48. under this change, please post it.
  49.  
  50.     I don't feel very comfortable with the approach, but it could be
  51. argued that, since the other paragraphs and sentences, although a little
  52. more vague, contradict this one, it should never have been interpreted as
  53. correct by right-thinking people in the first place (by a form of logic
  54. known as "majority rules" :^P )
  55.  
  56. Note that I don't beleive FD_CLOSE should be posted in either FIN_WAIT_1
  57. OR FIN_WAIT_2 - after sending the local FIN, both the remote ends ACK
  58. and FIN should be received before posting FD_CLOSE (which is when the
  59. stack enters TIME_WAIT).
  60.  
  61. Note 2: I'm sure its not a good idea to be scattering details that may
  62. or may not apply to implementations internally within a spec of this
  63. sort, mandating the internal structure. I don't think talking about
  64. when to post FD_CLOSE in terms of internal states, particularly when they
  65. are specific to TCP/IP, is very smart at all, and the whole
  66. paragraph will have to be re-written to support a more protocol-neutral
  67. approach when WinSock/IPX and WinSock/Appletalk are being discussed.
  68.  
  69. Again: can anybody else think of any way that an application might break
  70. if I alter our Winsock so that FD_CLOSE is posted when the remote
  71. end's FIN arrives - that is, in CLOSE_WAIT or TIME_WAIT, _not_ FIN_WAIT ?
  72.  
  73.  
  74. -- 
  75. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  76. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  77. 579 Harris St., Ultimo   |                         |  been superseded.
  78. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  79. From paul@atlas.dev.abccomp.oz.au Fri May  6 05:15:58 1994
  80. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  81.           id AA16895; Thu, 5 May 1994 20:02:34 -0400
  82. Received: by usage.csd.unsw.OZ.AU id AA17267
  83.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Fri, 6 May 1994 10:02:23 +1000
  84. Received: by atlas (4.1/1.35)
  85.     id AA20074; Fri, 6 May 94 10:16:00 EST
  86. Message-Id: <9405060016.AA20074@atlas>
  87. From: paul@atlas.abccomp.oz.au
  88. Date: Fri, 6 May 1994 10:15:58 -0500
  89. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  90. To: Bruce@isi.frontiertech.com,
  91.         Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  92. Subject: Re: Curious behaviour from winsock
  93.  
  94. Thus expounded Bruce@isi.FrontierTech.COM on May 5,10:05am:
  95. /--------------------
  96. |
  97. |>>  My Conclusion: The quoted portions are 2:1 in favour of posting
  98. |FD_CLOSE
  99. |>>          when the remote'd FIN arrives, NOT when the local app calls
  100. |>>          shutdown/closesocket. Any stack that does not behave so is
  101. |>>          only 33% WinSock compliant w.r.t. FD_CLOSE, and we should be
  102. |>>          as understanding as possible of the confusion.
  103. |>
  104. |Unfortunately, the 33% which that stack agrees with is the most explicit
  105. |reference, and the others could possibly be interpreted in different ways
  106. |to support either side of the argument. 
  107.  
  108. Bruce,
  109.     Sorry, but I'm a bit dozy this morning.
  110.  
  111.     How can the paragraph starting "The error code in an FD_CLOSE
  112. message ..." and the sentence "This results from the remote end performing
  113. a shutdown() on the send side or a closesocket()." be interpreted as
  114. supporting the premise that FD_CLOSE should be posted in FIN_WAIT - that is,
  115. as soon as the relevent call is made, possibly even before the FIN packet
  116. has gone out onto the wire?
  117.  
  118.     Inquiring minds, etc...
  119.  
  120.  
  121. -- 
  122. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  123. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  124. 579 Harris St., Ultimo   |                         |  been superseded.
  125. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  126. From bruce@isi.FrontierTech.COM Fri May  6 02:35:17 1994
  127. Received: from isi.FrontierTech.COM by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  128.           id AA11541; Fri, 6 May 1994 09:34:44 -0400
  129. Received: from bruces.FrontierTech.COM by isi.FrontierTech.COM (5.65/1.40)
  130.     id AA08817; Fri, 6 May 94 08:32:54 -0500
  131. X-Mailer: SuperTCP/NFS for Windows Version 4.00 (Mailer Version 1.02)
  132. Message-Id: <2DCA55A8-00000001@Bruces.FrontierTech.COM>
  133. From: Bruce@isi.FrontierTech.COM
  134. Date: Fri, 06 May 94 08:35:17 CST
  135. Subject: Re: Curious behaviour from winsock
  136. To: Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  137. Cc: paul@atlas.abccomp.oz.au
  138. Mime-Version: 1.0
  139. Content-Type: Text/Plain; Charset=US-ASCII
  140.  
  141. >       How can the paragraph starting "The error code in an FD_CLOSE
  142. >message ..." and the sentence "This results from the remote end
  143. performing
  144. >a shutdown() on the send side or a closesocket()." be interpreted as
  145. >supporting the premise that FD_CLOSE should be posted in FIN_WAIT - that
  146. is,
  147. >as soon as the relevent call is made, possibly even before the FIN packet
  148. >has gone out onto the wire?
  149. >
  150. When I wrote that, I was thinking someone who really wanted to split hairs
  151. could argue that it doesn't specify that the closesocket occurred on the
  152. remote (you could insert pauses at creative places to imply that the
  153. closesocket could be on either end).  Unfortunately, that would *also*
  154. conflict with the statement that closesocket cancels notifictations! 
  155.  
  156. I have no problem with posting in TIME_WAIT, but I do have a problem with
  157. branding stacks "noncompliant" because they followed an explicit statement
  158. in the spec (a statement which, ironically, was supposed to *reduce*
  159. confusion  : >  ).
  160.  
  161. ****************************************
  162. Bruce A Backman (Bruce@FrontierTech.COM)
  163. Frontier Technologies Corporation
  164. 10201 North Port Washington Road
  165. Mequon,  WI  53092
  166. ***************************************
  167.  
  168.